package gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;
import java.sql.SQLException;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JList;
import javax.swing.JTextPane;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;

import secretaryGUI.createSecretaryWindow;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import guiCode.assignmentscode;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.border.BevelBorder;
import javax.swing.border.CompoundBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;

public class CurrentCoursesIDGUI extends JPanel{
	public JTable table;
	public JScrollPane scrollPane;
	public JButton btnRetun;
	public JLabel lblName;
	
	public CurrentCoursesIDGUI(){
			super();
			initialize();
		}
		private void initialize() {
			this.setSize(900,600);
			this.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
			SpringLayout springLayout = new SpringLayout();
			setLayout(springLayout);
			
			JPanel panel = new JPanel();
			panel.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
			springLayout.putConstraint(SpringLayout.NORTH, panel, 88, SpringLayout.NORTH, this);
			springLayout.putConstraint(SpringLayout.WEST, panel, 45, SpringLayout.WEST, this);
			springLayout.putConstraint(SpringLayout.SOUTH, panel, -23, SpringLayout.SOUTH, this);
			springLayout.putConstraint(SpringLayout.EAST, panel, 646, SpringLayout.WEST, this);
			add(panel);
			SpringLayout sl_panel = new SpringLayout();
			panel.setLayout(sl_panel);
			
			JLabel lblCourseName = new JLabel("course name:");
			lblCourseName.setFont(new Font("Tahoma", Font.PLAIN, 16));
			lblCourseName.setForeground(Color.BLUE);
			sl_panel.putConstraint(SpringLayout.NORTH, lblCourseName, 41, SpringLayout.NORTH, panel);
			sl_panel.putConstraint(SpringLayout.WEST, lblCourseName, 55, SpringLayout.WEST, panel);
			panel.add(lblCourseName);
			
			lblName = new JLabel("name");
			lblName.setFont(new Font("Tahoma", Font.PLAIN, 14));
			lblName.setForeground(Color.BLUE);
			sl_panel.putConstraint(SpringLayout.WEST, lblName, 43, SpringLayout.EAST, lblCourseName);
			sl_panel.putConstraint(SpringLayout.SOUTH, lblName, 0, SpringLayout.SOUTH, lblCourseName);
			panel.add(lblName);
			
			JLabel lblListOfCourses = new JLabel("list of courses id");
			sl_panel.putConstraint(SpringLayout.WEST, lblListOfCourses, 0, SpringLayout.WEST, lblName);
			sl_panel.putConstraint(SpringLayout.EAST, lblListOfCourses, -272, SpringLayout.EAST, panel);
			lblListOfCourses.setFont(new Font("Tahoma", Font.BOLD, 15));
			panel.add(lblListOfCourses);
			
		
			
			table = new JTable();
			sl_panel.putConstraint(SpringLayout.NORTH, table, 22, SpringLayout.SOUTH, lblListOfCourses);
			sl_panel.putConstraint(SpringLayout.WEST, table, 158, SpringLayout.WEST, panel);
			sl_panel.putConstraint(SpringLayout.SOUTH, table, 75, SpringLayout.SOUTH, lblListOfCourses);
			sl_panel.putConstraint(SpringLayout.EAST, table, 431, SpringLayout.WEST, panel);
			
		
			table = new JTable();
			table.setModel(new DefaultTableModel(
				new Object[][] {
					{null},
					{null},
				},
				new String[] {
					"New column"
				}
			));
			
			scrollPane = new JScrollPane(table);
			sl_panel.putConstraint(SpringLayout.SOUTH, lblListOfCourses, -17, SpringLayout.NORTH, scrollPane);
			sl_panel.putConstraint(SpringLayout.NORTH, scrollPane, 183, SpringLayout.NORTH, panel);
			sl_panel.putConstraint(SpringLayout.SOUTH, scrollPane, -174, SpringLayout.SOUTH, panel);
			sl_panel.putConstraint(SpringLayout.WEST, scrollPane, 0, SpringLayout.WEST, lblName);
			sl_panel.putConstraint(SpringLayout.EAST, scrollPane, -139, SpringLayout.EAST, panel);
			panel.add(scrollPane);
			
			btnRetun = new JButton("Return to to select a course");
			btnRetun.setFont(new Font("Tahoma", Font.BOLD, 13));
			
			sl_panel.putConstraint(SpringLayout.NORTH, btnRetun, 43, SpringLayout.SOUTH, scrollPane);
			sl_panel.putConstraint(SpringLayout.WEST, btnRetun, 90, SpringLayout.WEST, panel);
			panel.add(btnRetun);
				
			
	}
		public void setCourseName(String s1){
		//s1=course name
			lblName.setText(s1)	;
			
		}
}
